home *** CD-ROM | disk | FTP | other *** search
/ Internet Pratica / IPRAT_01.iso / ASP / ASPapp Portal / default.asp < prev    next >
Encoding:
Text File  |  2002-03-13  |  11.6 KB  |  570 lines

  1. <!-- #include file="i_utils.asp" -->
  2. <%
  3. %>
  4. <% page_heading = "WELCOME" %>
  5. <%
  6.     dim CatID
  7.     dim DateAdded
  8.     dim LinkID
  9.     dim Title
  10.     dim whats_new_sql
  11.     dim whats_hot_sql
  12.     dim whats_cool_sql
  13.     dim default_section
  14.     dim privacy_section
  15.     dim features
  16.     dim upgrade
  17.     dim valueclick_ad_code
  18.     dim blurb
  19.  
  20. sub request_whats_new
  21. ''' request expected input parameters for this form
  22.     CatID = request("CatID")
  23.     DateAdded = request("DateAdded")
  24.     LinkID = request("LinkID")
  25.     Title = request("Title")
  26. end sub
  27. sub request_whats_hot
  28. ''' request expected input parameters for this form
  29.     CatID = request("CatID")
  30.     LinkID = request("LinkID")
  31.     Title = request("Title")
  32. end sub
  33. sub request_whats_cool
  34. ''' request expected input parameters for this form
  35.     CatID = request("CatID")
  36.     LinkID = request("LinkID")
  37.     Title = request("Title")
  38. end sub
  39.  
  40. sub validate_whats_new
  41. ''' request and validate data entered from this form
  42.     CatID = trim(request("CatID"))
  43.     DateAdded = trim(request("DateAdded"))
  44.     if DateAdded <> "" AND (not isdate(DateAdded)) then
  45.         error_list.add "488395date","DateAdded must be a valid date (MM/DD/YY)."
  46.         b_error = true
  47.     end if
  48.     LinkID = trim(request("LinkID"))
  49.     Title = trim(request("Title"))
  50. end sub
  51. sub validate_whats_hot
  52. ''' request and validate data entered from this form
  53.     CatID = trim(request("CatID"))
  54.     LinkID = trim(request("LinkID"))
  55.     Title = trim(request("Title"))
  56. end sub
  57. sub validate_whats_cool
  58. ''' request and validate data entered from this form
  59.     CatID = trim(request("CatID"))
  60.     LinkID = trim(request("LinkID"))
  61.     Title = trim(request("Title"))
  62. end sub
  63.  
  64.  
  65. sub db_select_whats_new
  66.     whats_new_sql = "SELECT TOP 8  " & _ 
  67.     "CatID, " & _ 
  68.     "DateAdded, " & _ 
  69.     "LinkID, " & _ 
  70.     "Title FROM Links " & _ 
  71.     "WHERE (Display=TRUE) AND (" & Date & " - DateAdded) < 5 " & _ 
  72.     "ORDER BY DateAdded DESC"
  73. end sub
  74. sub db_delete_whats_new
  75.     sql = "DELETE FROM " & _ 
  76.     ""
  77.     'response.write sql
  78.     on error resume next
  79.     cn.Execute(sql)
  80.     if err.number <> 0 then
  81.         b_error = true
  82.     end if
  83.     on error goto 0
  84. end sub
  85. sub db_select_whats_hot
  86.     whats_hot_sql = "SELECT TOP 8  " & _ 
  87.     "CatID, " & _ 
  88.     "DateAdded, " & _ 
  89.     "LinkID, " & _ 
  90.     "Title FROM Links " & _ 
  91.     "ORDER BY ClickThrus DESC"
  92. end sub
  93. sub db_delete_whats_hot
  94.     sql = "DELETE FROM " & _ 
  95.     ""
  96.     'response.write sql
  97.     on error resume next
  98.     cn.Execute(sql)
  99.     if err.number <> 0 then
  100.         b_error = true
  101.     end if
  102.     on error goto 0
  103. end sub
  104. sub db_select_whats_cool
  105.     whats_cool_sql = "SELECT TOP 8  " & _ 
  106.     "CatID, " & _ 
  107.     "DateAdded, " & _ 
  108.     "LinkID, " & _ 
  109.     "Title FROM Links " & _ 
  110.     "ORDER BY AvgRating DESC"
  111. end sub
  112. sub db_delete_whats_cool
  113.     sql = "DELETE FROM " & _ 
  114.     ""
  115.     'response.write sql
  116.     on error resume next
  117.     cn.Execute(sql)
  118.     if err.number <> 0 then
  119.         b_error = true
  120.     end if
  121.     on error goto 0
  122. end sub
  123.  
  124. do_search = request("do_search")
  125. ''' request form keys
  126. ''' request action
  127. action = lcase(request("action"))
  128. ''' action case handler
  129. select case action
  130.  
  131. end select
  132.  
  133. '  no action was specified, so handle the default case(s)
  134. db_select_whats_cool
  135. db_select_whats_hot
  136. db_select_whats_new
  137. %>
  138.  
  139. <!-- #include file='i_header.asp' -->
  140. <!-- #include file='i_menu.asp' -->
  141.  
  142.  
  143.  
  144.  
  145. <%
  146. display_errs
  147. display_msg
  148. %>
  149.  
  150. <table STYLE="{padding:3px;}">
  151. <tr valign=top>
  152. <td width='170' style="{padding:5px;}">
  153. <!-- start left column -->
  154. <%
  155.  
  156. page_no = request("page_no")
  157. if page_no = "" then page_no = 1
  158.  
  159. if whats_new_sql <> "" then
  160.     cmd.CommandText = whats_new_sql
  161.     rs.Filter = ""
  162.     rs.CursorLocation = 3
  163.     rs.CacheSize = 5
  164.     rs.Open cmd
  165.     if not rs.EOF then
  166.             rs.MoveFirst
  167.             max_count = cInt(rs.PageCount)
  168.             num_recs = rs.RecordCount
  169.             rs.AbsolutePage = page_no
  170.             results = true
  171.     else
  172.         results = false
  173.         rs.Close
  174.     end if
  175. else
  176.     results = false
  177. end if
  178. rec_count = 0
  179.  
  180. %>
  181.  
  182. <table class='headerTable'>
  183. <tr>
  184. <td class='headerTD'>
  185. New links
  186. </td>
  187. </tr>
  188. </table>
  189. <%
  190.  
  191. if results = true then
  192.  
  193. %>
  194.  
  195. <table  >
  196. <form name="whats_new" action="default.asp" method="get" >
  197. <%
  198.  
  199. do while not rs.EOF
  200.  
  201. ':: read db record
  202. on error resume next
  203. CatID = rs("CatID")
  204. DateAdded = rs("DateAdded")
  205. LinkID = rs("LinkID")
  206. Title = rs("Title")
  207. on error goto 0
  208.  
  209. %>
  210.         
  211.         
  212.         
  213.     <td class='dataTD' >
  214.         <% title = left(title,20) %><a href="links.asp?CatId=<% =CatId %>"><% =Title %></a>..
  215.     </td>
  216. </tr>
  217. <%
  218.  
  219. rs.MoveNext
  220. rec_count = rec_count + 1
  221. loop
  222. rs.Close
  223.  
  224. %>
  225.  
  226. </form>
  227. </table>
  228. <%
  229.  
  230. else
  231.  
  232. %>
  233.  
  234.     
  235.  
  236. <%
  237.  
  238. end if
  239.  
  240. %>
  241.  
  242.  
  243. <br><br>
  244. <%
  245.  
  246. page_no = request("page_no")
  247. if page_no = "" then page_no = 1
  248.  
  249. if whats_hot_sql <> "" then
  250.     cmd.CommandText = whats_hot_sql
  251.     rs.Filter = ""
  252.     rs.CursorLocation = 3
  253.     rs.CacheSize = 5
  254.     rs.Open cmd
  255.     if not rs.EOF then
  256.             rs.MoveFirst
  257.             max_count = cInt(rs.PageCount)
  258.             num_recs = rs.RecordCount
  259.             rs.AbsolutePage = page_no
  260.             results = true
  261.     else
  262.         results = false
  263.         rs.Close
  264.     end if
  265. else
  266.     results = false
  267. end if
  268. rec_count = 0
  269.  
  270. %>
  271.  
  272. <table class='headerTable'>
  273. <tr>
  274. <td class='headerTD'>
  275. Popular links
  276. </td>
  277. </tr>
  278. </table>
  279. <%
  280.  
  281. if results = true then
  282.  
  283. %>
  284.  
  285. <table  >
  286. <form name="whats_hot" action="default.asp" method="get" >
  287. <%
  288.  
  289. do while not rs.EOF
  290.  
  291. ':: read db record
  292. on error resume next
  293. CatID = rs("CatID")
  294. LinkID = rs("LinkID")
  295. Title = rs("Title")
  296. on error goto 0
  297.  
  298. %>
  299.         
  300.         
  301.     <td class='dataTD' >
  302.         <% title = left(title,22) %><a href="links.asp?CatId=<% =CatId %>"><% =Title %></a>..
  303.     </td>
  304. </tr>
  305. <%
  306.  
  307. rs.MoveNext
  308. rec_count = rec_count + 1
  309. loop
  310. rs.Close
  311.  
  312. %>
  313.  
  314. </form>
  315. </table>
  316. <%
  317.  
  318. else
  319.  
  320. %>
  321.  
  322.     
  323.  
  324. <%
  325.  
  326. end if
  327.  
  328. %>
  329.  
  330.  
  331. <br><br>
  332. <%
  333.  
  334. page_no = request("page_no")
  335. if page_no = "" then page_no = 1
  336.  
  337. if whats_cool_sql <> "" then
  338.     cmd.CommandText = whats_cool_sql
  339.     rs.Filter = ""
  340.     rs.CursorLocation = 3
  341.     rs.CacheSize = 5
  342.     rs.Open cmd
  343.     if not rs.EOF then
  344.             rs.MoveFirst
  345.             max_count = cInt(rs.PageCount)
  346.             num_recs = rs.RecordCount
  347.             rs.AbsolutePage = page_no
  348.             results = true
  349.     else
  350.         results = false
  351.         rs.Close
  352.     end if
  353. else
  354.     results = false
  355. end if
  356. rec_count = 0
  357.  
  358. %>
  359.  
  360. <table class='headerTable'>
  361. <tr>
  362. <td class='headerTD'>
  363. Cool links
  364. </td>
  365. </tr>
  366. </table>
  367. <%
  368.  
  369. if results = true then
  370.  
  371. %>
  372.  
  373. <table  >
  374. <form name="whats_cool" action="default.asp" method="get" >
  375. <%
  376.  
  377. do while not rs.EOF
  378.  
  379. ':: read db record
  380. on error resume next
  381. CatID = rs("CatID")
  382. LinkID = rs("LinkID")
  383. Title = rs("Title")
  384. on error goto 0
  385.  
  386. %>
  387.         
  388.         
  389.     <td class='dataTD' >
  390.         <% title = left(title,22) %><a href="links.asp?CatId=<% =CatId %>"><% =Title %></a>..
  391.     </td>
  392. </tr>
  393. <%
  394.  
  395. rs.MoveNext
  396. rec_count = rec_count + 1
  397. loop
  398. rs.Close
  399.  
  400. %>
  401.  
  402. </form>
  403. </table>
  404. <%
  405.  
  406. else
  407.  
  408. %>
  409.  
  410.     
  411.  
  412. <%
  413.  
  414. end if
  415.  
  416. %>
  417.  
  418.  
  419. <!-- end left column -->
  420. </td>
  421.  
  422. <td style="{padding:0px;}">
  423. <table cellspacing=0 style={padding:0px;width:'100%';}>
  424. <tr>
  425.     <td  >
  426.         <% if request("section") = "" then %><!--#include file='i_links_yahoo.asp' --><% end if %>
  427.     </td>
  428. </tr>
  429. <tr>
  430.     <td  >
  431.         <% if request("section") = "privacy" then %><!-- #include file='i_privacy.asp' --><% end if %>
  432.     </td>
  433. </tr>
  434.  
  435.  
  436. </table>
  437. <TABLE>
  438. <TR>
  439. <TD style="{padding:6px;}">
  440. <table cellspacing=1 border=0 bgcolor="#000000">
  441. <tr>
  442.     <td style="{padding:6px;color:#222222}" bgcolor="#FFFFFF">
  443.     This site is a demonstration of the complete, easy-to-modify PortalApp system designed for broad, vertical(vortals) and niche portals.
  444.     With this portal you can create and manage site content, links, discussion forums, classified ads, surveys and more. The entire portal application is another robust demonstration of <A href='http://www.aspapp.com' style='{color:#000000}'>rapid-apps development with ASPapp.com</A>.
  445.     To demonstrate the portal administration areas, <A style='{color:#000000}' href='login.asp?user_name=admin&password=admin&action=login'>click here</A>, or <A href='login.asp'>login</A> using:<br>
  446.     username: admin<br>
  447.     password: admin<br>
  448.     <br><br>
  449.     The fonts and colors used throughout are based on standard .css style sheets, so
  450.     the entire design is easy to change... 
  451.     <a href='default.asp?skin_number=0' style='{color:#000000}' >standard</A> | 
  452.     <a href='default.asp?skin_number=1' style='{color:#000000}' >example 1</A> | 
  453.     <a href='default.asp?skin_number=2' style='{color:#000000}' >example 2</A> | 
  454.     <a href='default.asp?skin_number=3' style='{color:#000000}' >example 3</A>
  455.  
  456.     <br>
  457.  
  458.         <br><br>
  459. <b>User, Link & Content Management</b><br>
  460. <ul>
  461. Yahoo style link display and management. Create and manage multple category levels, and enable user listing submission. Administrator can approve listings.
  462. <ul>
  463. <li>organize hierarchical categories of links
  464. <li>yahoo style searching
  465. <li>user listing submission
  466. <li>approve, edit, administer listings
  467. <li>HTML content authoring
  468. <li>
  469. </ul>
  470. </ul>
  471. <p>
  472. This is the free, non-supported version. For a full-featured portal with extended functionality, visit <a href='http://www.aspapp.com'>ASPapp.com</A>
  473.  
  474.  
  475.     <p align=right><A href="http://www.aspapp.com"><img src="http://www.aspapp.com/apps/images/aspapplogo_sm.gif" width=81 height=36 border=0 alt="generated by aspapp.com"></a></p>
  476.  
  477.     </td>
  478. </tr>
  479. </table>
  480. </TD>
  481. </TD>
  482. </TABLE>
  483.  
  484. <!-- end center col -->
  485. </td>
  486. </td>
  487. <td width='150' STYLE="{padding:5px;}">
  488. <!-- start right column -->
  489. <table class='headerTable'>
  490. <tr>
  491. <td class='headerTD'>
  492. Upgrade
  493. </td>
  494. </tr>
  495. </table>
  496.         Extended your portal's features...<br><br>
  497.  
  498. <li>WYSIWYG content authoring
  499. <li>survey/poll manager
  500. <li>rate/rank listings
  501. <li>"featured" content
  502. <li>who's online
  503. <li>user messaging
  504. <li>traffic statistics
  505. <li>multiple content layouts (ie; articles, news, etc..) 
  506. <li>discussion forums
  507. <li>classified ads service
  508. <li>image gallery
  509. <li>file/image uploading
  510. <li>password lookup
  511. <li>newsletter management
  512. <li>email confirmation
  513. <li>personalization
  514. <li>RFP/bidding module
  515. <li>technical support 
  516.  
  517. <br>
  518. Visit <a href='http://www.aspapp.com'>ASPapp</A> for more information
  519.  
  520.  
  521.  
  522. <br><br>
  523. <table align="center" width="100%" style="{padding:1px;border-width:1px;border-style:solid;border-color:#000000}" class="blue_md">
  524. <tr><td colspan=2 class="topnav">Visit Our Sponsor</td></tr>
  525. </table>
  526.  
  527.         <p align=center>
  528. <br>
  529. <!-- VC active -->
  530. <SCRIPT LANGUAGE="JavaScript">
  531. <!--
  532.     // ValueParameters
  533.     ValueHost = "hs0000062";
  534.     ValueLoaded = false;
  535.     ValueID = "valueid";
  536.     ValueVersion = "1.1";
  537.     ValueWidth = 125;
  538.     ValueHeight = 125;
  539.     //-->
  540.     </SCRIPT>
  541.     <SCRIPT LANGUAGE="Javascript" SRC="http://oz.valueclick.com/jsmaster"></SCRIPT>
  542.     <SCRIPT LANGUAGE="JavaScript">
  543.     <!--
  544.     if (ValueLoaded) ValueShowAd();
  545. //-->
  546. </SCRIPT>
  547. <NOSCRIPT>
  548. <A HREF="http://kansas.valueclick.com/redirect?host=hs0000062&size=125x125&b=indexpage&v=0" TARGET="_top"><IMG BORDER="0" WIDTH="125" HEIGHT="125" ALT="Click here to visit our sponsor"
  549. SRC="http://kansas.valueclick.com/cycle?host=hs0000062&size=125x125&b=indexpage&noscript=1"></A>
  550. </NOSCRIPT>
  551. <!-- vc active -->
  552.  
  553.  
  554. <br><br>
  555. <table align="center" width="100%" style="{padding:1px;border-width:1px;border-style:solid;border-color:#000000}" class="blue_md">
  556. <tr><td colspan=2 class="topnav">Building a Portal?</td></tr>
  557. </table>
  558.         <div align=left>
  559. Do you need a portal engine for your topic, regional, or industry specific site?
  560. This portal can be customized to include statistics, personlization, content authoring, and other custom features.
  561. <br><br>
  562. To find out more, or to download other free source code, visit <A href='http://www.aspapp.com'>ASPapp.com</A>
  563. </div>
  564.  
  565.  
  566.  
  567. <br><br>
  568.  
  569. <! -- end right column -->
  570. </td>
  571. </tr>
  572. </table>
  573.  
  574.  
  575. <!-- #include file=i_footer.asp -->
  576.  
  577.  
  578. <%
  579. ':: assure that any db resources are freed
  580. on error resume next
  581. rs.Close
  582. set rs = NOTHING
  583. cn.Close
  584. set cn = NOTHING
  585. user_cn.Close
  586. set user_cn = NOTHING
  587. on error goto 0
  588. %>
  589.